home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- '''Abstract class for AES.'''
-
- class AES:
-
- def __init__(self, key, mode, IV, implementation):
- if len(key) not in (16, 24, 32):
- raise AssertionError()
- len(key) not in (16, 24, 32)
- if mode != 2:
- raise AssertionError()
- mode != 2
- if len(IV) != 16:
- raise AssertionError()
- len(IV) != 16
- self.isBlockCipher = True
- self.block_size = 16
- self.implementation = implementation
- if len(key) == 16:
- self.name = 'aes128'
- elif len(key) == 24:
- self.name = 'aes192'
- elif len(key) == 32:
- self.name = 'aes256'
- else:
- raise AssertionError()
- return len(key) == 16
-
-
- def encrypt(self, plaintext):
- if not len(plaintext) % 16 == 0:
- raise AssertionError
-
-
- def decrypt(self, ciphertext):
- if not len(ciphertext) % 16 == 0:
- raise AssertionError
-
-
-